import { App } from '@vue/runtime-core'
import {
  Button,
  Card,
  Dropdown,
  Form,
  Input,
  InputNumber,
  Layout,
  Menu,
  Modal,
  Popconfirm,
  Table
} from 'ant-design-vue'
// 自定义组件
import SvgIcon from '@/components/svgIcon/SvgIcon'
import DynamicSvgIcon from '@/components/svgIcon/DynamicSvgIcon'

const customComponets = [
  SvgIcon,
  DynamicSvgIcon
]

const components = [
  Button,
  Card,
  Dropdown,
  Dropdown.Button,
  Form,
  Form.Item,
  Input,
  Input.Password,
  Input.TextArea,
  InputNumber,
  Layout,
  Layout.Content,
  Layout.Header,
  Layout.Sider,
  Menu,
  Menu.Item,
  Modal,
  Popconfirm,
  Table,
  ...customComponets
]

export const registerComponent = (app: App) => {
  components.forEach(component => {
    app.component(component.name, component)
  })
}
